define(function (require, exports, module) {
	
	var HandlerBars = require("handlebars");
	var cartEvents = require("../handler/cartEvents");
	var cartItemsTpl = require("../assets/tpl/cart_items.tpl");
    var instance = {
    	//初始化购物车
        initCart: function (widget) {
        	var cartData = localStorage.getItem("cartData");
    		if(cartData){
    			cartData = JSON.parse(cartData);
    		}else{
    			cartData = {};
    		}
        	cartEvents.setTotalPrice(widget,cartData);
        	cartEvents.updataCartDom(widget,cartData);
        }
    };
    module.exports = instance;
});
